<%@ page contentType="text/html; charset=utf-8" %>
<%@ include file="/WEB-INF/jsp/com/include/declare.jspf" %>
<%@ include file="/WEB-INF/jsp/com/include/doctype.jspf" %>
<link rel="stylesheet" type="text/css" href="/kr/common/css/print.css" media="print" />
<script type="text/javascript" src="/kr/common/js/pie/pie_ready.js"></script>
<script type="text/javascript">
    // Run capabilities test
    enhance({
        loadScripts: [
            {src: '/kr/common/js/pie/excanvas.js', iecondition: 'all'},
            '/kr/common/js/pie/chart_jQuery.js',
            '/kr/common/js/pie/view.js'
        ],
        loadStyles: [
            '/kr/common/css/pie/chart.css',
        ]
    });

    var T;
    function fnNumForm(xVal, yVal, type){
        T = Number('1e' + 1);
        var result;

        if(type == "*"){
            result = Math.round((parseFloat( xVal ) * parseFloat( yVal )) * T) / T;
        }
        if(type == "/"){
            result = Math.round((parseFloat( xVal ) / parseFloat( yVal )) * T) / T;
        }
        if(type == "+"){
            result = Math.round((parseFloat( xVal ) + parseFloat( yVal )) * T) / T;
        }
        if(type == "-"){
            result = Math.round((parseFloat( xVal ) - parseFloat( yVal )) * T) / T;
        }
        return result;
    }
    
    function fnNumberFormat(input){
        var input = String(input);
        var reg = /(\-?\d+)(\d{3})($|\.\d+)/;
        if(reg.test(input)){
            return input.replace(reg, function(str, p1, p2, p3){
                return fnNumberFormat(p1) + "," + p2 + "" + p3;
            });
        }else{
            return input;
        }
    }

    /**************************************
    A * r * (1 + r)^n / ((1 + r)^n - 1)
    ***************************************/
//  A : 원금총액
//  r : 할부이율
//  n : 할부개월
    
    function fnIstmIntMonth(a, n){
    //a : 원금총액 = hb_won_price
    //r : 할부이율 = hb_int_pro_month
    //n : 할부개월 = hb_month
        if(n >= "12" || n < "60"){
            r = 7.95 / 100 / 12;
        }else{
            r = 8.6 / 100 / 12;
        }
        var fst = Math.pow((1 + r), n);
        var sec = a * r * (fst) / ((fst) - 1);
        var fnh = Math.round(sec);
        var result = fnNumberFormat(fnh);
        $("#monthlypay").val( fnh );
        return result;
    }

    function fnIstmIntMonthTot(a, n){
        if(n >= "12" || n < "60"){
            r = 7.95 / 100 / 12;
        }else{
            r = 8.6 / 100 / 12;
        }
        var fst = Math.pow((1 + r), n);
        var sec = a * r * (fst) / ((fst) - 1);
        var fnh = Math.round(sec);
        
        hb_tot_price = (fnh * n) - a;
        var result = fnNumberFormat(hb_tot_price);
        //hb_tot_price
        $("#interest").val(hb_tot_price);
        return result;
    }
    
    function InsertValue(){
        
        var param = $('form[name="insertForm"]').serialize();
        
        $.post("updateEstComCarInfo.do",
                param,
                function(data){
                    var result={};
                    var items = $(data).find("item");
                    items.each(function(index,element){
                       var name = $(this).find("name").text();
                       var value = $(this).find("value").text();
                       result[name] = value;
                    });
                    if(result["result"] =="OK"){
                        alert("견적저장이 완료되었습니다.");
                        //location.replace("estimationgeneral.do");
                        //top.location.reload();
                    } 
                }
        );
    }
    
    $(document).ready(function(){
        
        $('#selectCarImg').attr('src', $('#imagepath').val() );
        
        if ( $("#pay").val() == "B" ){
            $('#hbMonthly').html(fnIstmIntMonth( $('#halbuWon1').val(), $('#paymonth').val()));
            $('#hbTotaly').html(fnIstmIntMonthTot( $('#halbuWon1').val(), $('#paymonth').val()));
            $('#hbMonthlyG').html(fnIstmIntMonth( $('#halbuWon1').val(), $('#paymonth').val()));
            $('#hbTotalyG').html(fnIstmIntMonthTot( $('#halbuWon1').val(), $('#paymonth').val()));
            if($('#paymonth').val() >= 12 && $('#paymonth').val() < 60){
                $('#hbYearPro').html('7.95');
                $('#hbYearProG').html('7.95');
                $('#interestrate').val('7.95');
            }else{
                $('#hbYearPro').html('8.6');
                $('#hbYearProG').html('8.6');
                $('#interestrate').val('8.6');
            }
            $('#txtHal').html("오토할부");
            $('#GCC').html( $('#outbeforemoney').val() );
            $('#GCH').html( $('#halbuWon1').val() );
            $('#GCR').html( $('#cuCarcost').val() );
        }else{
            $('#hbMonthly').html('0');
            $('#hbTotaly').html('0');
            $('#hbMonthlyG').html('0');
            $('#hbTotalyG').html('0');
            $('#hbYearPro').html('0');
            $('#hbYearProG').html('0');
            $('#paymonth').val('0');
            $('#txtHal').html("일시불");
            $('#GCC').html( $('#outbeforemoney').val() );
            $('#GCH').html( "0" );
            $('#GCR').html( $('#cuCarcost').val() );
        }
    });

    
    function varlogin(obj){
        var obj = obj;
        if ( $('#username').val() != "" && $('#email').val() != ""  ){
            if( obj == 'Save' ){
                InsertValue();    
            }else if( obj == 'Mail' ){
                mail();  
            }
        }else{
            var param = "cate="+obj;
            $.ajax({
                type:'POST',
                url:'estimationlogin.do',
                data:param,
                dataType:'html',
                cache:false,
                error:function(){
                   alert("팝업의 데이터를 가져오지 못하였습니다."); 
                },
                success:function ( html, status ){
                    $('#popContents').html(html);
                    fnInsertPopup('#popContents');
                }
            });
        }
    }
    
    function fnInsertPopup(area){
        $(area).height('');
        $('body').dimmedFrame();
        $('.dimmed-frame').css({height:$("#wrap").height()});
        $(area).css("display", "");
        $(area).css({top:$(window).scrollTop()+550}).show();
        $('#mbrEml').focus();
        
    }
    
    function closeLayer(area){
        $('.dimmed-frame').remove();
        $(area).html("");
        $('#popContents').html("");
        $(area).hide(); 
    }
    
    function reloadArea( _obj, _oa, _ob ){
        $('.dimmed-frame').remove();
        $('#popContents').hide();
        $('#username').val( _oa );
        $('#email').val( _ob );
        var obj = _obj;
        if ( obj == 'Save' ){
            InsertValue();  
        }else if ( obj == 'Mail' ){
            mail();
        }
        
    }
    
    function mail(){        
        var quotno = $("#quotno").val();
        var param = "quotno="+quotno;
        
        $.post("estimation_mail.do",
                param,
                function(data){
                    var result={};
                    var items = $(data).find("item");
                    items.each(function(index,element){
                       var name = $(this).find("name").text();
                       var value = $(this).find("value").text();
                       result[name] = value;
                    });
                    if(result["result"] =="OK"){
                        alert("메일이 정상 발송되었습니다.");
                        //location.reload();
                    } 
                }
        );
    } 
    
    function fnPrint(id) {
        
        window.print();
    }
    
</script>
</head>
<body>
<%-- <%@ include file="/WEB-INF/jsp/com/include/layerpopup.jspf" %> --%>


<div id="wrap" class="non-subnavigation" >
    <%@ include file="/WEB-INF/jsp/com/include/navi_utill_sub.jspf" %>
    <%@ include file="/WEB-INF/jsp/com/include/navi_header.jspf" %>
    <hr />

    <%@ include file="/WEB-INF/jsp/com/include/sub_header_estimation01.jspf" %>
    <hr />
 
    <div id="container">
        <div id="subtitle-area"><div class="subtitle-area-inner">
            <%@ include file="/WEB-INF/jsp/com/include/location.jspf" %>
        </div></div>
        <div id="article">

        <form name="insertForm" id="insertForm" method="post" action="" >
        <input type="hidden" name="quotno" id="quotno" value="<c:out value="${estComVO.quotno}"/>" />
        <input type="hidden" name="username" id="username" value="<c:out value="${mbrInfoVO.mbrNm }"/>" />
        <input type="hidden" name="userid" id="userid" value="<c:out value="${mbrInfoVO.mbrSn }"/>" />
        <input type="hidden" name="postlast" id="postlast" value="" />
        <input type="hidden" name="postfirst" id="postfirst" value="" />
        <input type="hidden" name="addr" id="addr" value="<c:out value="${mbrInfoVO.adr }"/>" /><!-- 고객주소 -->
        <input type="hidden" name="addr2" id="addr2" value="" />
        <input type="hidden" name="email" id="email" value="<c:out value="${mbrInfoVO.mbrEml }"/>" />
        <input type="hidden" name="vehlMdlCd" id="vehlMdlCd" value="<c:out value="${estComVO.vehlMdlCd}"/>"/>
        <input type="hidden" name="setCd" id="setCd" value="<c:out value="${estComVO.setCd}"/>"/>
        <input type="hidden" name="tmcode" id="tmcode" value="<c:out value="${estComVO.tmcode}"/>"/>
        <input type="hidden" name="carcode" id="carcode" value="<c:out value="${estComVO.carcode}"/>"/>
        <input type="hidden" name="gradecode" id="gradecode" value="<c:out value="${estComVO.gradecode}"/>"/>
        <input type="hidden" name="trimcode" id="trimcode" value="<c:out value="${estComVO.trimcode}"/>"/>
        <input type="hidden" name="opcode" id="opcode" value="<c:out value="${estComVO.opcode}"/>"/>
        <input type="hidden" name="optioncode" id="optioncode" value="<c:out value="${estComVO.optnCd}"/>"/>
        <input type="hidden" name="colorcode" id="colorcode" value="<c:out value="${estComVO.nTcolorcode}"/>"/>
        <input type="hidden" name="carprice" id="carprice" value="<c:out value="${estComVO.basicPrice}"/>"/>
        <input type="hidden" name="colorprice" id="colorprice" value="<c:out value="${estComVO.nTcolorprice}"/>"/>
        <input type="hidden" name="optionprice" id="optionprice" value="<c:out value="${estComVO.optPrice}"/>"/>
        <input type="hidden" name="transprice" id="transprice" value="<c:out value="${estComVO.cnsgFee}"/>"/>
        <input type="hidden" name="makerdc" id="makerdc" value="<c:out value="${estComVO.dcntAmt}"/>"/> <!-- DC 세이브포인트 -->
        <input type="hidden" name="cardpoint" id="cardpoint" value="<c:out value="${estComVO.mPoint}"/>"/>
        <input type="hidden" name="cardpoint2" id="cardpoint2" value="<c:out value="${estComVO.bPoint}"/>"/><!-- ADD  -->
        <input type="hidden" name="contractfee" id="contractfee" value="<c:out value="${estComVO.cuContractfee}"/>"/><!-- 계약금 -->
        <input type="hidden" name="receiveprice" id="receiveprice" value="<c:out value="${estComVO.cuCarPrice}"/>"/><!-- 인수가격 계산 -->
        <input type="hidden" name="carname" id="carname" value="<c:out value="${estComVO.carname}"/>"/>
        <input type="hidden" name="colorname" id="colorname" value="<c:out value="${estComVO.nTcolorname}"/>"/>
        <input type="hidden" name="optionname" id="optionname" value="<c:out value="${estComVO.optnItemNm}"/>"/>
        <input type="hidden" name="totalpayment" id="totalpayment" value="<c:out value="${estComVO.hb_wn }"/>"/> <!-- 총할부금 -->
        <input type="hidden" name="paymentfee" id="paymentfee" value="<c:out value="${estComVO.cuHbSusuPro }"/>"/><!-- 할부수수료 -->
        <input type="hidden" name="stampfee" id="stampfee" value="2000"/><!-- 증지대 -->
        <input type="hidden" name="paymenttype" id="paymenttype" value="J16" /><!-- 할부코드 -->
        <input type="hidden" name="paymentname" id="paymentname" value="오토할부" /><!-- 할부명칭 -->
        <input type="hidden" name="paymonth" id="paymonth" value="<c:out value="${estComVO.hb_cd}"/>"/>
        <input type="hidden" name="interestrate" id="interestrate" value="" /><!--요율구분  -->
        <input type="hidden" name="monthlypay" id="monthlypay" value="" /><!-- 월할부금 -->
        <input type="hidden" name="paymentflag" id="paymentflag" value="<c:out value="${estComVO.pay}"/>"/><!-- 결제방식 -->
        <input type="hidden" name="lowdownrate" id="lowdownrate" value="<c:out value="${estComVO.cuHbInt}"/>"/><!-- 최저선수율 -->
        <input type="hidden" name="bondflag" id="bondflag" value="<c:out value="${estComVO.gc}"/>"/><!-- 공채적용여부 -->
        <input type="hidden" name="regcostReg" id="regcostReg" value="<c:out value="${estComVO.cuRegcostReg }"/>"/><!-- 등록세 -->
        <input type="hidden" name="bonddc" id="bonddc" value="<c:out value="${estComVO.cuBonddc }"/>"/><!-- 공채할인금 -->
        <input type="hidden" name="regcostPlate" id="regcostPlate" value="25000" />
        <input type="hidden" name="regcostSafetyfee" id="regcostSafetyfee" value="" /><!-- 안전협회비 -->
        <input type="hidden" name="regcostRegi" id="regcostRegi" value="55000" /><!-- 등록대행료 -->
        <input type="hidden" name="getcost" id="getcost" value="<c:out value="${estComVO.cuGetcost }"/>"/><!-- 취득세 -->
        <input type="hidden" name="regprice" id="regprice" value="<c:out value="${estComVO.cuCarcost }"/>"/><!-- 등록비 -->
        <input type="hidden" name="company" id="company" value="H" />
        <input type="hidden" name="yardcode" id="yardcode" value="<c:out value="${estComVO.cntrCd }"/>"/><!--출하장코드  -->
        <input type="hidden" name="dcflag" id="dcflag" value="" /><!-- 할인여부 -->
        <input type="hidden" name="regdate" id="regdate" value="" /><!--견적일  -->
        <input type="hidden" name="updtdate" id="updtdate" value="" /><!--견적일  -->
        <input type="hidden" name="quotflag" id="quotflag" value="" /><!--견적구분  -->
        <input type="hidden" name="bemonthlypay" id="bemonthlypay" value="" /><!-- 12개월내납입원금 -->
        <input type="hidden" name="gakjacode" id="gakjacode" value="<c:out value="${estComVO.setCd}"/>"/>      
        <input type="hidden" name="specflag" id="specflag" value="" />
        <input type="hidden" name="gmodelcode" id="gmodelcode" value="<c:out value="${estComVO.carcode}"/>"/>
        <input type="hidden" name="trimname" id="trimname" value="<c:out value="${estComVO.gradeDname}"/>"/>
        <input type="hidden" name="gradename" id="gradename" value="<c:out value="${estComVO.gradename}"/>"/>
        <input type="hidden" name="colorname2" id="colorname2" value="<c:out value="${estComVO.nIcolorname}"/>"/>
        <input type="hidden" name="colorprice2" id="colorprice2" value="<c:out value="${estComVO.nIcolorprice}"/>"/>
        <input type="hidden" name="trimprice" id="trimprice" value="<c:out value="${estComVO.tmprice}"/>"/><!-- basicPrice + tmprice -->
        <input type="hidden" name="colorcode2" id="colorcode2" value="<c:out value="${estComVO.nIcolorcode}"/>"/>
        <input type="hidden" name="imagepath" id="imagepath" value="<c:out value="${estComVO.imagepath }"/>"/><!-- 컬러선택이미지파일경로 -->
        <input type="hidden" name="halbuWon1" id="halbuWon1" value="<c:out value="${estComVO.hb_wn}"/>"/><!-- total -  -->
        <input type="hidden" name="halbuWon2" id="halbuWon2" value="" /><!--유예할부금  -->
        <input type="hidden" name="indoMoney" id="indoMoney" value="<c:out value="${estComVO.cuIndo }"/>"/><!-- 인도금 -->
        <input type="hidden" name="injidae" id="injidae" value="<c:out value="${estComVO.stmpFee }"/>"/><!-- 인지대 -->
        <input type="hidden" name="dankiBohom" id="dankiBohom" value="<c:out value="${estComVO.cuDankiBohom }"/>" /><!-- 단기의무보험 -->
        <input type="hidden" name="outbeforemoney" id="outbeforemoney" value="<c:out value="${estComVO.cuCarPrice }"/>"/><!--출고전납입총액  -->
        <input type="hidden" name="gongchemoney" id="gongchemoney" value="<c:out value="${estComVO.cuGongchemoney }"/>"/><!-- 공채매입액 -->
        <input type="hidden" name="intRt1" id="intRt1" value="<c:out value="${estComVO.preRt }"/>"/><!-- 할부이율 -->
        <input type="hidden" name="regnNm" id="regnNm" value="<c:out value="${estComVO.regnNm}"/>"/><!-- 배송지역 -->
        <input type="hidden" name="cdName" id="cdName" value="<c:out value="${estComVO.rgArea}"/>"/><!-- 등록지역 -->
        <input type="hidden" name="interest" id="interest" value="" /><!-- 할부총이자 -->
        <input type="hidden" name="delYn" id="delYn" value="N" />
        <input type="hidden" name="baseDc" id="baseDc" value="<c:out value="${estComVO.dcntsAmt }"/>"/> <!-- 기본조건 -->
        <input type="hidden" name="partscode" id="partscode" value="<c:out value="${estComVO.partsCd}"/>"/>
        <input type="hidden" name="partsname" id="partsname" value="<c:out value="${estComVO.partsNm}"/>"/>
        <input type="hidden" name="partsprice" id="partsprice" value="<c:out value="${estComVO.partsprice}"/>"/>
        <input type="hidden" name="pay" id="pay" value="<c:out value="${estComVO.pay}"/>"/>
        <input type="hidden" name="cuCarcost" id="cuCarcost" value="<c:out value="${estComVO.cuCarcost }"/>"/>
        <input type="hidden" name="cuEtcPrice" id="cuEtcPrice" value="<c:out value="${estComVO.cuEtcPrice }"/>"/>
        <input type="hidden" name="cuTotalPrice" id="cuTotalPrice" value="<c:out value="${estComVO.cuTotalPrice }"/>"/>
        
                
            <div id="printArea" class="estimation-com-wrap">
                <div class="total-thumb">
                    <div class="car-name">
                        <c:out value="${estComVO.carname }"/>
                        <em><c:out value="${estComVO.gradename }"/> <c:out value="${estComVO.gradeDname }"/></em>
                    </div>
                    <div class="car-wrap">
                        <img src="<c:out value="${estComVO.imagepath }"/>" id="selectCarImg" alt="선택 차량 이미지" class="car-thumb" />
                    </div>
                    <div class="selected-stats-wrap">
                        <div class="selected-stats">
                            <img src="/kr/images/estimation/txt_estimation_complete01.gif" alt="고객님의 총 차량견적 금액" />
                            <span class="price"><script>document.write(fnNumberFormat(<c:out value="${estComVO.cuTotalPrice}"/>));</script><em>원</em></span>
                        </div>
                        <p class="benefit">차량 금액 중 <b class="point01"><script>document.write(fnNumberFormat(<c:out value="${estComVO.dcntsAmt}"/>));</script>원</b> 구입혜택<c:if test="${estComVO.dcntNm != '' }">과 <b class="point01"><c:out value="${estComVO.dcntNm }"/></b>를 </c:if><c:if test="${estComVO.dcntNm == '' }">을</c:if>받으셨습니다.</p>
                    </div>
                    <h5><img src="/kr/images/title/h5_estimation_complete01.gif" alt="할부사항" /></h5>
                    <div class="pie-graph-wrap">
                        <table class="aa" style="display:none;">
                            <thead>
                                <tr>
                                    <td></td>
                                    <th scope="col"></th>
                                    <th scope="col"></th>
                                    <th scope="col"></th>
                                </tr>
                            </thead>
                            <tbody>
                                <tr>
                                    <th scope="row">현금</th>
                                    <td id="GCC"></td>
                                </tr>
                                <tr>
                                    <th scope="row">할부</th>
                                    <td id="GCH"></td>
                                </tr>
                                <tr>
                                    <th scope="row">등록</th>
                                    <td id="GCR"></td>
                                </tr>
                            </tbody>
                        </table>
                        <img src="/kr/images/estimation/circle.png" alt="차트 이미지" class="circle" />
                    </div>
                    <div class="plan-status">
                        <div class="cell">
                            <img src="/kr/images/estimation/txt_estimation_complete02.gif" alt="월 납입금" />
                            <p class="price"><span id="hbMonthlyG"></span><em>원</em></p>
                        </div>
                        <div class="cell">
                            <img src="/kr/images/estimation/txt_estimation_complete03.gif" alt="할부원금/기간" />
                            <p class="result"><script>document.write(fnNumberFormat(<c:out value="${estComVO.hb_wn}"/>));</script>원 / <c:out value="${estComVO.hb_cd}"/>개월</p>
                        </div>
                        <div class="cell">
                            <img src="/kr/images/estimation/txt_estimation_complete04.gif" alt="할부이자/이율" />
                            <p class="result"><span id="hbTotalyG"></span>원 / <span id="hbYearProG"></span>%</p>
                        </div>
                    </div>
                    <div class="datatable-wrap">
                        <table summary="할부유형, 할부원금/기간, 총할부이자/이율, 월납입금">
                        <caption>할부사항 정리</caption>
                        <colgroup>
                            <col width="25%" />
                            <col width="25%" />
                            <col width="25%" />
                            <col width="25%" />
                        </colgroup>
                        <thead>
                        <tr>
                            <th scope="col"><img src="/kr/images/estimation/txt_estimation_complete05.gif" alt="할부유형" /></th>
                            <th scope="col"><img src="/kr/images/estimation/txt_estimation_complete06.gif" alt="할부원금/기간" /></th>
                            <th scope="col"><img src="/kr/images/estimation/txt_estimation_complete07.gif" alt="할부이자총액/이율" /></th>
                            <th scope="col"><img src="/kr/images/estimation/txt_estimation_complete08.gif" alt="월납입금" /></th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td><span id="txtHal">오토할부</span></td>
                            <td><script>document.write(fnNumberFormat(<c:out value="${estComVO.hb_wn}"/>));</script>원 <br/>/ <c:out value="${estComVO.hb_cd}"/>개월</td>
                            <td><span id="hbTotaly"></span>원<br />/ <span id="hbYearPro"></span>%</td>
                            <td class="last"><b class="point01"><span id="hbMonthly"></span> 원</b></td>
                        </tr>
                        </tbody>
                        </table>
                    </div>
                </div>
                <div class="estimation-detail">
                    <h5><img src="/kr/images/title/h5_estimation_complete02.gif" alt="견적 가격사항" /></h5>
                    <div class="datatable-wrap">
                        <table summary="항목, 내역, 가격">
                        <caption>견적 가격사항 정리</caption>
                        <colgroup>
                            <col width="24%" />
                            <col width="38%" />
                            <col width="38%" />
                        </colgroup>
                        <thead>
                        <tr>
                            <th scope="col"><img src="/kr/images/estimation/txt_estimation_complete09.gif" alt="항목" /></th>
                            <th scope="col"><img src="/kr/images/estimation/txt_estimation_complete10.gif" alt="내역" /></th>
                            <th scope="col"><img src="/kr/images/estimation/txt_estimation_complete11.gif" alt="가격" /></th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td class="sort">차종</td>
                            <td> <c:out value="${estComVO.carname }"/> / <c:out value="${estComVO.gradename }"/> / <c:out value="${estComVO.gradeDname }"/> / 
                                <c:if test="${estComVO.tmcode == 'T'}">AT</c:if>
                                <c:if test="${estComVO.tmcode == 'M'}">MT</c:if>
                            </td>
                            <td class="price last"><b><script>document.write(fnNumberFormat(<c:out value="${estComVO.basicPrice}"/>));</script>원</b></td>
                        </tr>
                        <tr>
                            <td class="sort">색상</td>
                            <td><c:out value="${estComVO.nTcolorname}"/></td>
                            <td class="price last"><b><script>document.write(fnNumberFormat(<c:out value="${estComVO.nTcolorprice}"/>));</script>원</b></td>
                        </tr>
                        <tr>
                            <td class="sort">내장</td>
                            <td><c:out value="${estComVO.nIcolorname}"/></td>
                            <td class="price last"><b><script>document.write(fnNumberFormat(<c:out value="${estComVO.nIcolorprice}"/>));</script>원</b></td>
                        </tr>
                        <tr>
                            <td class="sort">옵션</td>
                            <td><c:out value="${estComVO.optnItemNm}"/></td>
                            <td class="price last"><b><script>document.write(fnNumberFormat(<c:out value="${estComVO.optPrice}"/>));</script>원</b></td>
                        </tr>
                        <tr>
                            <td class="sort">TUIX</td>
                            <td><c:out value="${estComVO.partsNm}"/></td>
                            <td class="price last"><b><script>document.write(fnNumberFormat(<c:out value="${estComVO.partsprice}"/>));</script>원</b></td>
                        </tr>
                        <tr>
                            <td class="sort">탁송료</td>
                            <td><c:out value="${estComVO.regnNm }"/></td>
                            <td class="price last"><b><script>document.write(fnNumberFormat(<c:out value="${estComVO.cnsgFee}"/>));</script>원</b></td>
                        </tr>
                        <tr>
                            <td rowspan="3" class="sort">할인금액</td>
                            <td>이달의 구입조건</td>
                            <td class="price last"><c:if test="${fn:length(estComVO.dcntsAmt) > 1}">(-)</c:if><b><script>document.write(fnNumberFormat(<c:out value="${estComVO.dcntsAmt}"/>));</script>원</b></td>
                        </tr>
                        <tr>
                            <td>세이브포인트</td>
                            <td class="price last"><c:if test="${fn:length(estComVO.dcntAmt) > 1}">(-)</c:if><b><script>document.write(fnNumberFormat(<c:out value="${estComVO.dcntAmt}"/>));</script>원</b></td>
                        </tr>
                        <tr>
                            <td>카드포인트</td>
                            <td class="price last"><c:if test="${fn:length(estComVO.mPoint) > 1}">(-)</c:if><b><script>document.write(fnNumberFormat(<c:out value="${estComVO.mPoint}"/>));</script>원</b></td>
                        </tr>
                        </tbody>
                        </table>
                    </div>
                    <p class="tip">포인트 중 <fmt:formatNumber type="NUMBER"  groupingUsed="true"><c:out value="${estComVO.cuEtcPrice}"/></fmt:formatNumber>원은 포인트 차감으로 지불조건에서 자동 계산됩니다.</p>
                    <!-- <p class="tip"><b>“개별소비세가 인하된 차량 가격이 출고시점에 따라 변동될 수 있습니다.”</b></p> -->

                    <h5 class="subsection"><img src="/kr/images/title/h5_estimation_complete03.gif" alt="납입총액" /></h5>
                    <div class="datatable-wrap">
                        <table summary="항목, 내역, 가격">
                        <caption>견적 가격사항 정리</caption>
                        <colgroup>
                            <col width="25%" />
                            <col width="25%" />
                            <col width="25%" />
                            <col width="25%" />
                        </colgroup>
                        <thead>
                        <tr>
                            <th scope="col"><img src="/kr/images/estimation/txt_estimation_complete12.gif" alt="구분" /></th>
                            <th scope="col"><img src="/kr/images/estimation/txt_estimation_complete13.gif" alt="항목" /></th>
                            <th scope="col"><img src="/kr/images/estimation/txt_estimation_complete14.gif" alt="가격" /></th>
                            <th scope="col"><img src="/kr/images/estimation/txt_estimation_complete15.gif" alt="합계" /></th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr>
                            <td rowspan="5" class="sort">출고전<br />납입금액</td>
                            <td class="sort02">계약금</td>
                            <td class="price"><spn id="p1"><fmt:formatNumber type="NUMBER"  groupingUsed="true"><c:out value="${estComVO.cuContractfee }"/></fmt:formatNumber></spn>원</td>
                            <td rowspan="5" class="price last">
                                <b><span id="pt1"><fmt:formatNumber type="NUMBER"  groupingUsed="true"><c:out value="${estComVO.cuCarPrice }"/></fmt:formatNumber></span>원</b>
                             </td>
                        </tr>
                        <tr>
                            <td class="sort02">인도금</td>
                            <td class="price"><spn id="p2"><fmt:formatNumber type="NUMBER"  groupingUsed="true"><c:out value="${estComVO.cuIndo }"/></fmt:formatNumber></spn>원</td>
                        </tr>
                        <tr>
                            <td class="sort02">금융회사 수수료</td>
                            <td class="price">
                            <spn id="p3"><fmt:formatNumber type="NUMBER"  groupingUsed="true"><c:out value="${estComVO.cuHbSusuPro }"/></fmt:formatNumber></spn>
                                    원
                            </td>
                        </tr>
                        <tr>
                            <td class="sort02">인지대</td>
                            <td class="price"><spn id="p5"><fmt:formatNumber type="NUMBER"  groupingUsed="true"><c:out value="${estComVO.stmpFee }"/></fmt:formatNumber></spn>원</td>
                        </tr>
                        <tr>
                            <td class="sort02">단기의무보험</td>
                            <td class="price"><!--계산  -->
                                <spn id="p6"><fmt:formatNumber type="NUMBER"  groupingUsed="true"><c:out value="${estComVO.cuDankiBohom }"/></fmt:formatNumber></spn>원
                             </td>
                        </tr>
                        <tr>
                            <td rowspan="6" class="sort">차량등록<br />비용</td>
                            <td class="sort02">등록대행수수료</td>
                            <td class="price"><span id="p7">55,000</span>원</td>
                            <td rowspan="6" class="price last"><b><span id="pt2"><fmt:formatNumber type="NUMBER"  groupingUsed="true"><c:out value="${estComVO.cuCarcost }"/></fmt:formatNumber></span>원</b></td>
                        </tr>
                        <tr>
                            <td class="sort02">취득세</td>
                            <td class="price">
                                <span id="p8"><fmt:formatNumber type="NUMBER"  groupingUsed="true" pattern="#,##0"><c:out value="${estComVO.cuRegcuCost}"/></fmt:formatNumber></span>원<!-- 100원미만절삭 -->
                            </td>
                        </tr>
                        <tr>
                            <td class="sort02">공채매입금액</td>
                            <td class="price"><span id="p9"><fmt:formatNumber type="NUMBER"  groupingUsed="true"><c:out value="${estComVO.cuGongchemoney }"/></fmt:formatNumber></span>원</td>
                        </tr>
                        <tr>
                            <td class="sort02">공채할인금액</td>
                            <td class="price"><span id="p10"><fmt:formatNumber type="NUMBER"  groupingUsed="true"><c:out value="${estComVO.cuBonddc }"/></fmt:formatNumber></span>원</td>
                        </tr>
                        <tr>
                            <td class="sort02">증지대(수입인지)</td>
                            <td class="price"><span id="p11">2,000</span>원</td>
                        </tr>
                        <tr>
                            <td class="sort02">차량번호판</td>
                            <td class="price"><span id="p12">25,000</span>원</td>
                        </tr>
                        <!-- 20120919_등록세+취득세 요청
                        <tr>
                            <td colspan="2" class="sort03">취득세</td>
                            <td class="price"><fmt:formatNumber type="NUMBER"  groupingUsed="true"><c:out value="${estComVO.cuGetcost}"/></fmt:formatNumber>원</td>
                            <td class="price last"><b><span id="pt3"><fmt:formatNumber type="NUMBER"  groupingUsed="true"><c:out value="${estComVO.cuGetcost }"/></fmt:formatNumber></span>원</b></td>
                        </tr>
                         -->
                         <!-- 100원미만절삭 -->
                        </tbody>
                        <tfoot>
                        <tr>
                            <td colspan="3">납입총액</td>
                            <td class="price last"><b><span id="totalp"><fmt:formatNumber type="NUMBER"  groupingUsed="true"><c:out value="${estComVO.cuTotalCost }"/></fmt:formatNumber></span>원</b></td>
                        </tr>
                        </tfoot>
                        </table>
                    </div>
                    <p class="tip">채권할인시 발생되는 위탁수수료는 포함되지 않습니다.</p>
                </div>
            </div>
            <div  id="gocompletelogin" class="btnwrap">
                <a href="javascript:fnPrint('printArea');" id="printButton"><img src="/kr/images/common/button/btn_print.gif" alt="인쇄" /></a>
                <a href="javascript:varlogin('Save');" ><img src="/kr/images/common/button/btn_estimation_save.gif" alt="견적저장"   /></a>
                <a href="javascript:varlogin('Mail');"><img src="/kr/images/common/button/btn_send_mail.gif" alt="메일전송" /></a>
            </div>
            <div class="estimation-service-wrap">
                <div class="service-notice">
                    <strong><img src="/kr/images/estimation/txt_estimation_complete16.gif" alt="알려드립니다!" /></strong>
                    <p>본 견적 내용은 고객님의 차량 구입 의사결정에 도움을 드리고자 하는 것으로 법적인 효력은 없습니다. 계약을 원하실 경우 별도로 청약의사표시를 하셔야 하며,<br />
                    실제 계약 내용은 청약하실 시점의 차량가격변동, 판매조건이나 캐피탈의 대출조건에 따라 본 견적 내용과 달라질 수 있습니다. 현대자동차는 지점/대리점의 카마스터를<br />
                    통해서만 판매하며, 전국 어느 곳에서나 같은 제품 같은 가격으로 바른 거래를 실천하고 있습니다.</p>
                </div>
                
                <div class="purchase-guide-cont2 subsection">
                    <div class="area odd">
                        <h4><img src="/kr/images/estimation/h4_purchase02.gif" alt="견적" /></h4>
                        <h5 class="link-title"><a href="/kr/estimation/estimationgeneral.do">견적내기</a></h5>
                        <h5 class="link-title"><a href="/kr/estimation/compare.do">경쟁차 비교</a></h5>
                        <h5 class="link-title"><a href="/kr/sale/selectPurCndMgmtList.do">이달의 구매혜택</a></h5>
                        <div class="icon-area"><img src="/kr/images/estimation/img_purchase02.gif" alt="견적 아이콘 이미지" /></div>
                    </div>
                    <div class="area">
                        <h4><img src="/kr/images/estimation/h4_purchase01.gif" alt="신청" /></h4>
                        <h5 class="link-title one-title"><a href="/kr/ctlg/req/selectCtlgPaging.do">카탈로그 신청</a></h5>
                        <div class="icon-area"><img src="/kr/images/estimation/img_purchase01.gif" alt=" 아이콘 이미지" /></div>
                    </div>
                    <div class="area odd">
                        <h4><img src="/kr/images/estimation/h4_purchase04.gif" alt="상담" /></h4>
                        <h5 class="link-title"><a href="/kr/pur/purMgmtFrontView.do">구매상담신청</a></h5>
                        <h5 class="link-title"><a href="/kr/biz/selectDspCarPaging.do">전시차 조회</a></h5>
                        <h5 class="link-title"><a href="/kr/biz/selectBizNwrkMgmtPaging.do">대리점/지점 조회</a></h5>
                        <div class="icon-area"><img src="/kr/images/estimation/img_purchase04.gif" alt="상담 아이콘 이미지" /></div>
                    </div>
                    <div class="area">
                        <h4><img src="/kr/images/estimation/h4_purchase03.gif" alt="시승" /></h4>
                        <h5 class="link-title one-title"><a href="/kr/tda/index.do">시승서비스</a></h5>
                        <div class="icon-area"><img src="/kr/images/estimation/img_purchase03.gif" alt="시승 아이콘 이미지" /></div>
                    </div>
                </div>

            </div>
        </form>
        </div>
    </div>
    <hr />
    <script>
    appendMETA('WT.ti','견적완료');
    dcsMultiTrack('DCS.dcssip','www.hyundai.com','DCS.dcsurl','/kr/estimation/estimationcompleteview.do','WT.ti','홈_견적_견적내기_견적완료','WT.si_n','Hyundai_Estimate','WT.si_x','5',
            'WT.si_cs','1','WT.pn_sku','${estComVO.vehlMdlCd}','WT.tx_e','P','WT.tx_u','1','WT.tx_s','${estComVO.cuTotalPrice }');
    </script>
    <%@ include file="/WEB-INF/jsp/com/include/footer.jspf" %>
    <div id="popContents"></div>    